package original;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class connectionUtil {
    static Channel getChannel()
    {
        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setHost("192.168.57.30");
        connectionFactory.setUsername("guest");
        connectionFactory.setPort(5672);
        connectionFactory.setPassword("guest");


        try {
            return connectionFactory.newConnection().createChannel();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (TimeoutException e) {
            throw new RuntimeException(e);
        }
    }

}
